#pragma once

#include <linux/types.h>
#include <asm/cmpxchg.h>

static inline void arch_atomic_set(atomic_t *v, int i)
{
    v->counter = i;
}

static inline int arch_atomic_read(const atomic_t *v)
{
    return v->counter;
}

int arch_atomic_add_return(int i, atomic_t *v);
int arch_atomic_fetch_add(int i, atomic_t *v);
void arch_atomic_add(int i, atomic_t *v);
void arch_atomic_sub(int i, atomic_t *v);

#define arch_atomic_add_return arch_atomic_add_return
#define arch_atomic_fetch_add arch_atomic_fetch_add
#define arch_atomic_add arch_atomic_add
#define arch_atomic_sub arch_atomic_sub
